package cn.gok.oop;

class Book{
    public String bookName;
    //私有的属性通过get和set方法进行访问
    private int pageCount;

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }
}

public class 封装 {
    public static void main(String[] args) {
        Book book = new Book();
        book.bookName = "";
        book.setPageCount(12);
        System.out.println(book.getPageCount());
    }
}
